#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int A[100010], B[100010], C[100010];

int cmp(int* A, int* B, int len1, int len2)
{
	if (len1 != len2)
	{
		if (len1 > len2)
			return 1;
		else
			return 0;
	}
	int i = 0;
	for (i = len1 - 1; i >= 0; i--)
	{
		if (A[i] != B[i])
		{
			if (A[i] > B[i])
				return 1;
			else
				return 0;
		}
	}
}
void sub(int A[], int B[], int len1, int len2)
{
	int i = 0;
	int k = 0;
	for (int i = 0,t = 0; i < len1; i++)
	{
		t = A[i] - t;
		if (i < len2)
		{
			t -= B[i];
		}
		C[i] = (t + 10) % 10;
		if (t < 0)
			t = 1;
		else
			t = 0;
	}
	while (C[len1 - 1] == 0 && len1 > 1)
	{
		len1--;
	}
	for (i = len1 - 1; i >= 0; i--)
		printf("%d", C[i]);
}
int main()
{
	char arr1[100010] = { 0 };
	char arr2[100010] = { 0 };
	int a[100010] = { 0 };
	int b[100010] = { 0 };
 	scanf("%s%s", arr1, arr2);
	int len1 = strlen(arr1);
	int len2 = strlen(arr2);

	for (int i = len1 - 1, j = 0; i >= 0; i--)
	{
		a[j++] = arr1[i] - '0';
	}
	for (int i = len1 - 1, j = 0; i >= 0; i--)
	{
		b[j++] = arr2[i] - '0';
	}
	if (cmp(a, b, len1, len2))
	{
		sub(a, b, len1, len2);
	}
	else
	{
		printf("-");
		sub(b, a, len2, len1);
	}
	return 0;
}